////////////////////////////////////////////////////////////////////////////////
//
//	This file is part of Woozox, see <http://code.google.com/p/woozox/>.
//
//	Copyright 2008-2009 Florian David
//
//	Woozoo is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as 
//	published by the Free Software Foundation, either version 3 of 
//	the License, or (at your option) any later version.
//
//	Woozoo is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public 
//	License along with Woozoo. If not, see <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
package org.woozoo.xhtml.unittests.selectorsuite.selector
{
	import org.flexunit.asserts.assertTrue;
	import org.woozoo.xhtml.unittests.selectorsuite.Case1;

	public class ComplexCase extends Case1
	{
		[Test(order=1)]
		public function complexeTest1() : void {
			results = document.$$('div#post-125C>p.postmetadata a[title="View all posts in Non classé"]');
			assertTrue(hasResultsAndLenEqual(1) && getFirstElement().innerHTML == "Non classé");
		}	
		[Test(order=2)]
		public function complexeTest2() : void {
			results = document.$$('p.postmetadata a[rel="category"]');
			assertTrue(hasResultsAndLenEqual(4));
		}	
		[Test(order=3)]
		public function complexeTest3() : void {
			results = document.$$('div#post-125C>p.postmetadata a[rel="category"]');
			assertTrue(hasResultsAndLenEqual(1));
		}	
		[Test(order=4)]
		public function complexeTest4() : void {
			results = document.$$('div#post-125C>p.postmetadata');
			assertTrue(hasResultsAndLenEqual(1));
		}	
		[Test(order=5)]
		public function complexeTest5() : void {
			results = document.$$('div#post-125C>p');
			assertTrue(hasResultsAndLenEqual(1));
		}	
		[Test(order=6)]
		public function complexeTest6() : void {
			results = document.$$('div#post-125C>p.postmetadata a[title]');
			assertTrue(	hasResultsAndLenEqual(2) && 
						getFirstElement().att('title') == "View all posts in Non classé" && 
						getElementAt(1).att('title') == "Comment on test video 2"
					  );
		}	
		[Test(order=7)]
		public function complexeTest7() : void {
			results = document.$$('div#post-125C>p.postmetadata a[title^="View"]');
			assertTrue(	hasResultsAndLenEqual(1) && 
						getFirstElement().att('title') == "View all posts in Non classé"
					  );
		}	
		
	}
}